﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CarMaintenanceReport.ascx.cs" Inherits="CS424_9pts.Manager.Modules.CarMaintenanceReport" %>
<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>

<div class="section-header">
    <div class="title">
        <img src="../Common/ico-sales.png" alt="Car Maintenance Report" />    
    </div>
    <div class="options">
    </div>
</div>

<asp:SqlDataSource  ID="SqlDataCarMaintenance" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:CarManagementConnectionString %>"
                    SelectCommand="SELECT * FROM [Maintenance]" 
    DeleteCommand="DELETE FROM [Maintenance] WHERE [MaintenanceID] = @MaintenanceID" 
    InsertCommand="INSERT INTO [Maintenance] ([ContractID], [DateToCompany], [Description], [Subtotal], [TaxID], [Total], [CurrencyID], [DateToManufacturer], [DateBackToCompany], [DateBackToCustomer], [SpanTimeMaintenace], [Status], [Note]) VALUES (@ContractID, @DateToCompany, @Description, @Subtotal, @TaxID, @Total, @CurrencyID, @DateToManufacturer, @DateBackToCompany, @DateBackToCustomer, @SpanTimeMaintenace, @Status, @Note)" 
    
    
    
    UpdateCommand="UPDATE [Maintenance] SET [ContractID] = @ContractID, [DateToCompany] = @DateToCompany, [Description] = @Description, [Subtotal] = @Subtotal, [TaxID] = @TaxID, [Total] = @Total, [CurrencyID] = @CurrencyID, [DateToManufacturer] = @DateToManufacturer, [DateBackToCompany] = @DateBackToCompany, [DateBackToCustomer] = @DateBackToCustomer, [SpanTimeMaintenace] = @SpanTimeMaintenace, [Status] = @Status, [Note] = @Note WHERE [MaintenanceID] = @MaintenanceID">
    <DeleteParameters>
        <asp:Parameter Name="MaintenanceID" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="ContractID" Type="Int32" />
        <asp:Parameter Name="DateToCompany" Type="DateTime" />
        <asp:Parameter Name="Description" Type="String" />
        <asp:Parameter Name="Subtotal" Type="Double" />
        <asp:Parameter Name="TaxID" Type="Int32" />
        <asp:Parameter Name="Total" Type="Double" />
        <asp:Parameter Name="CurrencyID" Type="Int32" />
        <asp:Parameter Name="DateToManufacturer" Type="DateTime" />
        <asp:Parameter Name="DateBackToCompany" Type="DateTime" />
        <asp:Parameter Name="DateBackToCustomer" Type="DateTime" />
        <asp:Parameter Name="SpanTimeMaintenace" Type="Int32" />
        <asp:Parameter Name="Status" Type="String" />
        <asp:Parameter Name="Note" Type="String" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="ContractID" Type="Int32" />
        <asp:Parameter Name="DateToCompany" Type="DateTime" />
        <asp:Parameter Name="Description" Type="String" />
        <asp:Parameter Name="Subtotal" Type="Double" />
        <asp:Parameter Name="TaxID" Type="Int32" />
        <asp:Parameter Name="Total" Type="Double" />
        <asp:Parameter Name="CurrencyID" Type="Int32" />
        <asp:Parameter Name="DateToManufacturer" Type="DateTime" />
        <asp:Parameter Name="DateBackToCompany" Type="DateTime" />
        <asp:Parameter Name="DateBackToCustomer" Type="DateTime" />
        <asp:Parameter Name="SpanTimeMaintenace" Type="Int32" />
        <asp:Parameter Name="Status" Type="String" />
        <asp:Parameter Name="Note" Type="String" />
        <asp:Parameter Name="MaintenanceID" Type="Int32" />
    </UpdateParameters>
</asp:SqlDataSource>

<asp:GridView ID="gvCarMaintenanceReport" runat="server" AllowPaging="True" 
    AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
    DataKeyNames="MaintenanceID" DataSourceID="SqlDataCarMaintenance" 
    ForeColor="#333333" GridLines="None" >
    <AlternatingRowStyle BackColor="White" />
    <Columns>
        <asp:BoundField DataField="MaintenanceID" HeaderText="MaintenanceID" 
            InsertVisible="False" ReadOnly="True" SortExpression="MaintenanceID" />
        <asp:BoundField DataField="ContractID" HeaderText="ContractID" 
            SortExpression="ContractID" />
        <asp:BoundField DataField="DateToCompany" HeaderText="DateToCompany" 
            SortExpression="DateToCompany" />
        <asp:BoundField DataField="Description" HeaderText="Description" 
            SortExpression="Description" />
        <asp:BoundField DataField="Subtotal" HeaderText="Subtotal" 
            SortExpression="Subtotal" />
        <asp:BoundField DataField="TaxID" HeaderText="TaxID" SortExpression="TaxID" />
        <asp:BoundField DataField="Total" HeaderText="Total" SortExpression="Total" />
        <asp:BoundField DataField="CurrencyID" HeaderText="CurrencyID" 
            SortExpression="CurrencyID" />
        <asp:BoundField DataField="DateToManufacturer" HeaderText="DateToManufacturer" 
            SortExpression="DateToManufacturer" />
        <asp:BoundField DataField="DateBackToCompany" HeaderText="DateBackToCompany" 
            SortExpression="DateBackToCompany" />
        <asp:BoundField DataField="DateBackToCustomer" HeaderText="DateBackToCustomer" 
            SortExpression="DateBackToCustomer" />
        <asp:BoundField DataField="SpanTimeMaintenace" HeaderText="SpanTimeMaintenace" 
            SortExpression="SpanTimeMaintenace" />
        <asp:BoundField DataField="Status" HeaderText="Status" 
            SortExpression="Status" />
        <asp:BoundField DataField="Note" HeaderText="Note" SortExpression="Note" />
    </Columns>
    <EditRowStyle BackColor="#2461BF" />
    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
    <RowStyle BackColor="#EFF3FB" />
    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
    <SortedAscendingCellStyle BackColor="#F5F7FB" />
    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
    <SortedDescendingCellStyle BackColor="#E9EBEF" />
    <SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
